

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Cruft and Notes &mdash; Cogent Viewer 0.1 documentation</title>
    
    <link rel="stylesheet" href="_static/rtd.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Cogent Viewer 0.1 documentation" href="index.html" />
    <link rel="next" title="My Install Notes" href="dansInstallNotes.html" />
    <link rel="prev" title="Rest Interface" href="restInterface.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="dansInstallNotes.html" title="My Install Notes"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="restInterface.html" title="Rest Interface"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Cogent Viewer 0.1 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="cruft-and-notes">
<h1>Cruft and Notes<a class="headerlink" href="#cruft-and-notes" title="Permalink to this headline">¶</a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="dansInstallNotes.html">My Install Notes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="dansInstallNotes.html#prep">Prep</a></li>
<li class="toctree-l2"><a class="reference internal" href="dansInstallNotes.html#base-code">Base Code</a></li>
<li class="toctree-l2"><a class="reference internal" href="dansInstallNotes.html#webinterface">Webinterface</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="dbVersion.html">Database Versioning and Migration</a><ul>
<li class="toctree-l2"><a class="reference internal" href="dbVersion.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="dbVersion.html#setup">Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="dbVersion.html#making-changes">Making Changes</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="jsonFunctions.html">JSON Interface</a><ul>
<li class="toctree-l2"><a class="reference internal" href="jsonFunctions.html#json-nav">Json Nav</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="newFeatures.html">Features to be Added</a><ul>
<li class="toctree-l2"><a class="reference internal" href="newFeatures.html#base-on-current-browser">Base on Current Browser</a></li>
<li class="toctree-l2"><a class="reference internal" href="newFeatures.html#new-stuff">New Stuff</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="testing.html">The Testing Database</a><ul>
<li class="toctree-l2"><a class="reference internal" href="testing.html#assumptions">Assumptions</a></li>
<li class="toctree-l2"><a class="reference internal" href="testing.html#house-1">House 1</a><ul>
<li class="toctree-l3"><a class="reference internal" href="testing.html#rooms-and-nodes">Rooms and Nodes</a></li>
<li class="toctree-l3"><a class="reference internal" href="testing.html#corner-case">Corner Case</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="testing.html#house-2">House 2</a><ul>
<li class="toctree-l3"><a class="reference internal" href="testing.html#id1">Rooms and Nodes</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<p>Headings Should Be as follows,  Anything Below Subsection Really should be avoided.</p>
</div>
<div class="section" id="part">
<h1>Part<a class="headerlink" href="#part" title="Permalink to this headline">¶</a></h1>
<p>Normal Text   ## with overline</p>
<div class="section" id="chapter">
<h2>Chapter<a class="headerlink" href="#chapter" title="Permalink to this headline">¶</a></h2>
<p>Normal Text ** With Overline</p>
<div class="section" id="section">
<h3>Section<a class="headerlink" href="#section" title="Permalink to this headline">¶</a></h3>
<p>Normal Text == Underline</p>
<div class="section" id="subsection">
<h4>Subsection<a class="headerlink" href="#subsection" title="Permalink to this headline">¶</a></h4>
<p>Normal Text &#8211; Underline</p>
<div class="section" id="subsubsection">
<h5>SubSubsection<a class="headerlink" href="#subsubsection" title="Permalink to this headline">¶</a></h5>
<p>Normal Text</p>
<div class="section" id="paragraph">
<h6>Paragraph<a class="headerlink" href="#paragraph" title="Permalink to this headline">¶</a></h6>
<p>Normal Text</p>
<div class="topic">
<p class="topic-title first">A quick Topic</p>
<p>This is a digression / seperate topic that we want to highlight</p>
</div>
<div class="sidebar">
<p class="first sidebar-title">Sidebar Title</p>
<p class="sidebar-subtitle">An Optional Subtitle</p>
<p class="last">We can also stick text into a sidebar, This gives an alternate form oh highighting</p>
</div>
<p>With a sidebar the text below is floated right and will flow around the sidebar itself.</p>
<p>This happens to all paragraphs headings etc. until we end up below the float</p>
</div>
</div>
</div>
</div>
<div class="section" id="running-under-apache-mod-wsgi">
<h3>Running under Apache mod-wsgi<a class="headerlink" href="#running-under-apache-mod-wsgi" title="Permalink to this headline">¶</a></h3>
<p>To Get the development application installed above to run under Apache
you need to:</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">For this example we use the pyramid configuration file <em>development.ini</em> this
keeps the debug toolbar etc.  For production servers it is recommended to use
the <em>production.ini</em> file.</p>
</div>
<ol class="arabic">
<li><p class="first">Install Apache and mod-wsgi:</p>
<div class="highlight-python"><pre>$sudo apt-get install apache2 libapache2-mod-wsgi</pre>
</div>
</li>
<li><p class="first">In the virtual env (ie testenv) created above create a pyramid.wsgi script Its contents should be along the lines of:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pyramid.paster</span> <span class="kn">import</span> <span class="n">get_app</span>
<span class="n">application</span> <span class="o">=</span> <span class="n">get_app</span><span class="p">(</span><span class="s">&quot;/home/dang/Progamming/Pyramid/viewer-repo/webinterface.rest/development.ini&quot;</span><span class="p">,</span><span class="s">&quot;main&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>The first part of the get_app function points to the paster.ini file used to run the application.  Technically, we should point to
the development.ini file with its greater level of security.  But in this instance we will just point to the testing development file.</p>
</li>
<li><p class="first">Make the pyramid.wsgi file executable</p>
</li>
<li><p class="first">Edit the apache configuration files so mod wsgi knows where to look by adding
the following to the default application <strong>/etc/apache2/sites-available/default</strong>:</p>
<div class="highlight-python"><pre>WSGIPythonHome /home/dang/Progamming/Pyramid/

&lt;VirtualHost&gt;
...
...
#Add MOD WSGI Pyramid Configuation
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=dang threads=4 python-path=/home/dang/Progamming/Pyramid/lib/python2.7/site-packages
WSGIScriptAlias /myapp /home/dang/Progamming/Pyramid/pyramid.wsgi #Mount at root


&lt;Directory /home/dang/Progamming/Pyramid/&gt;
   WSGIProcessGroup pyramid
   Order allow,deny
   Allow from all
&lt;/Directory&gt;

&lt;/VirtualHost&gt;</pre>
</div>
</li>
</ol>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Cruft and Notes</a><ul>
</ul>
</li>
<li><a class="reference internal" href="#part">Part</a><ul>
<li><a class="reference internal" href="#chapter">Chapter</a><ul>
<li><a class="reference internal" href="#section">Section</a><ul>
<li><a class="reference internal" href="#subsection">Subsection</a><ul>
<li><a class="reference internal" href="#subsubsection">SubSubsection</a><ul>
<li><a class="reference internal" href="#paragraph">Paragraph</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#running-under-apache-mod-wsgi">Running under Apache mod-wsgi</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="restInterface.html"
                        title="previous chapter">Rest Interface</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="dansInstallNotes.html"
                        title="next chapter">My Install Notes</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/cruft.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="dansInstallNotes.html" title="My Install Notes"
             >next</a> |</li>
        <li class="right" >
          <a href="restInterface.html" title="Rest Interface"
             >previous</a> |</li>
        <li><a href="index.html">Cogent Viewer 0.1 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2011, Daniel Goldsmith.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>